import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const Home = ()=>import('../views/Home')
const Category = ()=>import('../views/Category')
const Goodsinfo = ()=>import('../views/Goodsinfo')
const Profile = ()=>import('../views/Profile')
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    meta:{
      title:'首页',
    }
  },
  {
    path: '/goodsinfo/:id',
    name: 'Goodsinfo',
    component: Goodsinfo,
    meta:{
      title:'商品详情',
    }
  },
  {
    path:'/category',
    name:'Category',
    component:Category,
    meta:{
      title:'分类'
    }
  },
  {
    path:'/profile',
    name:'Profile',
    component:Profile,
    meta:{
      title:'分类'
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
